package com.lordjoe.collectiveintelligence;

/**
 * com.lordjoe.collectiveintelligence.TravelItem
 *
 * @author Steve Lewis
 * @date Mar 24, 2009
 */
public class TravelItem
{
    public static TravelItem[] EMPTY_ARRAY = {};
    public static Class THIS_CLASS = TravelItem.class;

    private final String m_Person;
    private final String m_Airport;

    public TravelItem(String pPerson, String pAirport)
    {
        m_Airport = pAirport;
        m_Person = pPerson;
    }

    public String getPerson()
    {
        return m_Person;
    }

    public String getAirport()
    {
        return m_Airport;
    }

    public boolean equals(Object o)
    {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TravelItem that = (TravelItem) o;

        if (m_Airport != null ? !m_Airport.equals(that.m_Airport) : that.m_Airport != null)
            return false;
        if (m_Person != null ? !m_Person.equals(that.m_Person) : that.m_Person != null)
            return false;

        return true;
    }

    public int hashCode()
    {
        int result;
        result = (m_Person != null ? m_Person.hashCode() : 0);
        result = 31 * result + (m_Airport != null ? m_Airport.hashCode() : 0);
        return result;
    }
}
